<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <f:view>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>Prestador</title>
            <link type="text/css" href="../common/css/redmond/jquery-ui-1.8.23.custom.css" rel="stylesheet" />
            <link type="text/css" href="../common/css/administrar.css" rel="stylesheet" />
            <script type="text/javascript" src="../common/js/jquery-1.8.0.min.js"></script>
            <script type="text/javascript" src="../common/js/jquery-ui-1.8.23.custom.min.js"></script>
            <script type="text/javascript" src="../common/js/prestador.js"></script>
            <script type="text/javascript" src="../common/js/jquery.tablesorter.min.js"></script>
            <script type="text/javascript" src="../common/js/jquery.metadata.js"></script>
            <script type="text/javascript" src="../common/js/jquery.tablesorter.pager.js"></script>
            <script type="text/javascript" src="../common/js/jquery.validate.js"></script>
            <script type="text/javascript" src="../common/js/jquery.qtip-1.0.0-rc3.js"></script> 
            <style type="text/css" title="currentStyle">
                @import "../common/css/demo_page.css";			
                @import "../common/css/demo_table_jui.css";


            </style>


            <script type="text/javascript" language="javascript" src="../common/js/jquery.dataTables.js"></script>

            <script>
                var asInitVals = new Array();

                $(document).ready(function() {
                    var oTable = $('#example').dataTable( {
                        "sPaginationType": "full_numbers",
                        "bJQueryUI": true,
                        "bProcessing": true,
                        "bServerSide": true,
                        "sAjaxSource": "/salus/PrestadorListaServlet",
                        "oLanguage": {
                            "sLengthMenu": "Mostrar _MENU_ registros por Pagina",
                            "sZeroRecords": "Opps - No se encontraron datos",
                            "sInfo": "Mostrando _START_ a _END_ de _TOTAL_ registros",
                            "sInfoEmpty": "Mostrando 0 a 0 de 0 registros",
                            "sInfoFiltered": "(filtered from _MAX_ total records)"
                        }

                    } );

                    $("tfoot input").keyup( function () {
                        /* Filter on the column (the index) of this element */
                        oTable.fnFilter( this.value, $("tfoot input").index(this) );
                    } );

                    $("tfoot input").each( function (i) {
                        asInitVals[i] = this.value;
                    } );

                    $("tfoot input").focus( function () {
                        if ( this.className == "search_init" )
                        {
                            this.className = "";
                            this.value = "";
                        }
                    } );

                    $("tfoot input").blur( function (i) {
                        if ( this.value == "" )
                        {
                            this.className = "search_init";
                            this.value = asInitVals[$("tfoot input").index(this)];
                        }
                    } );                               
                    $("#example tbody").dblclick(function(event) {
                        $(oTable.fnSettings().aoData).each(function (){
                            $(this.nTr).removeClass('row_selected');
                        });
                        $(event.target.parentNode).addClass('row_selected');
                        var anSelected = fnGetSelected( oTable );                                        
                        var dato=anSelected[0].cells;                                        
                        editar(dato[0].innerHTML,dato[1].innerHTML)
                    });
                    /* Add a click handler for the delete row */
                    $('#delete').click( function() {
                        var anSelected = fnGetSelected( oTable );
                        //oTable.fnDeleteRow( anSelected[0] );
                        var dato=anSelected[0].cells;
                        alert(dato[0].innerHTML);
                    } );
                } );
                function fnGetSelected( oTableLocal )
                {
                    var aReturn = new Array();
                    var aTrs = oTableLocal.fnGetNodes();

                    for ( var i=0 ; i &lt; aTrs.length ; i++ )
                    {
                        if ( $(aTrs[i]).hasClass('row_selected') )
                        {
                            aReturn.push( aTrs[i] );
                        }
                    }
                    return aReturn;
                }

            </script>


        </head>
        <body>
            <div style="width: 100%">

                <h3 style="text-align: center" class="ui-widget-header">Prestador</h3>

                <table width="100%">
                    <tr>
                        <td align="left">
                            <button id="nuevoPrestadorBtn">Nuevo</button> 
                        </td>
                        <td align="right">
                            <button id="ayudaBtn">Ayuda</button>               
                        </td>
                    </tr>
                </table>                
                <div class="tooltips"></div>

                <!--      
                  <div id="adm_grupoact">
                      <h3 style="text-align: center" class="ui-widget-header">Grupo Actividad</h3>
                      <p>
                          <button id="nuevaGrupoActividadBtn">Nuevo</button>
                      </p>
      
                      <div id="buscador-form">
                          <table border="0">
                              <tr valign="top" class="ui-widget-header">
                                  <td>C&oacute;digo</td>
                                  <td><input type="text" size="20" onkeyup="this.value=this.value.toUpperCase()" id="buscarCod" class="ui-widget-content"/></td>
                                  <td>Descripci&oacute;n</td>
                                  <td><input type="text" size="40" onkeyup="this.value=this.value.toUpperCase()" id="buscarDes" class="ui-widget-content"/></td>
                                  <td><button id="buscarBtn">Buscar</button></td>
                                  <td><button id="clearBtn">Limpiar</button></td>
                              </tr>
                          </table>
                      </div>
      
      
                      <table width="100%" id="tabla-grupoact" class="lista" >
                          <thead>
                              <tr>
                                  <th>C&oacute;digo</th>
                                  <th>Descripci&oacute;n</th>
                                  <th class="{sorter: false}">Opciones</th>
                              </tr>
                          </thead>
                          <tbody id="tabla-grupoact-body">
      
                          </tbody>
                      </table>
                      <div id="pager" class="pager">
                          <form>
                              <table>
                                  <tr class="ui-widget-header">
                                      <td>
                                          <img src="../common/img/first1.png" class="first"/>
                                      </td>
                                      <td>
                                          <img src="../common/img/prev1.png" class="prev"/>
                                      </td>
                                      <td>
                                          <input type="text" size="8" class="pagedisplay ui-widget-content"/>
                                      </td>
                                      <td>
                                          <img src="../common/img/next1.png" class="next"/>
                                      </td>
                                      <td>
                                          <img src="../common/img/last1.png" class="last"/>
                                      </td>
                                      <td>
                                          <select class="pagesize text ui-widget-content">
                                              <option selected="selected"  value="10">10</option>
                                              <option value="20">20</option>
                                              <option value="30">30</option>
                                              <option  value="40">40</option>
                                          </select>
                                      </td>
                                  </tr>
                              </table>
                          </form>
                      </div>
                  </div>
                -->
                <!--DATA TABLE-->                
                <div id="dynamic">
                    <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
                        <thead>
                            <tr>
                                <th width="5%">Sec</th>
                                <th width="10%">C&oacute;digo</th>
                                <th width="65%">Raz&oacute;n Social</th>                                                     
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td colspan="3" class="dataTables_empty">Loading data from server</td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr>                                
                                <th><input size="20" type="hidden" name="search_id" value="Secuencial" class="search_init" /></th>
                                <th><input type="text" onkeyup="this.value=this.value.toUpperCase()" name="search_numero" value="Numero" class="search_init" /></th>
                                <th><input type="text" onkeyup="this.value=this.value.toUpperCase()" name="search_descripcion" value="Raz&oacute;n Social" class="search_init" /></th>                                
                            </tr>
                        </tfoot>
                    </table>
                </div>

            </div>



            <div id="prestador-form" name="prestador-form" title="Info" style="display: none">


                <div id="tabs_prestador">
                    <ul>
                        <li><a href="#tabs-1">Informacion General</a></li>
                        <li><a href="#tabs-2">Informaci&oacute;n Adicional</a></li>

                    </ul>


                    <form name="nameformPrestador" id="formPrestador" action="/salus/AdministrarPrestador" enctype="multipart/form-data"  method="post" target="uploadiframe">

                        <div id="tabs-1"> 

                            <input type="hidden" id="op" name="op"/>
                            <table>
                                <tr>
                                    <td>Id</td>
                                    <td> <input readonly="true" type="text" size="10" name="id" id="id" class="ui-widget-content" /></td>                            
                                </tr>
                                <tr>
                                    <td>C&oacute;digo</td>
                                    <td> <input type="text" size="10" onkeyup="this.value=this.value.toUpperCase()" name="codigo" id="codigo" value="" class="ui-widget-content" /></td>
                                    <span id="error_num"></span>
                                </tr>
                                <tr>
                                    <td>Descripci&oacute;n</td>
                                    <td><input type="text" size="30" onkeyup="this.value=this.value.toUpperCase()" name="razonsocial" id="razonsocial" maxlength="200" value="" class="ui-widget-content" /></td>
                                </tr>
                                <tr>
                                    <td>Tipo identificaci&oacute;n</td>
                                    <td><select style="width: 330px"  name="idtipoiden" id="idtipoiden" class="text ui-widget-content" ></select></td>
                                </tr>
                                <tr>
                                    <td>N&uacute;mero Identificaci&oacute;n</td>
                                    <td><input type="text" size="30" onkeyup="this.value=this.value.toUpperCase()" name="numeroidentificacion" id="numeroidentificacion" maxlength="30" value="" class="ui-widget-content" /></td>                        
                                </tr>
                                <tr>
                                    <td>NIT</td>
                                    <td><input type="text" size="30" onkeyup="this.value=this.value.toUpperCase()" name="nit" id="nit" maxlength="25" value="" class="ui-widget-content" /></td>
                                </tr>

                                <tr>

                                    <td>Digito Verificaci&oacute;n</td>
                                    <td><input type="text" size="30" onkeyup="this.value=this.value.toUpperCase()" name="digitoverificacion" id="digitoverificacion" maxlength="1" value="" class="ui-widget-content" /></td>
                                    <!--<td><select name="digitoverificacion" id="digitoverificacion" style="width: 330px" class="text ui-widget-content">-->

                                </tr>
                                <tr>
                                    <td>Nivel</td>
                                    <td><select name="nivel" id="nivel" style="width: 330px" class="text ui-widget-content">
                                            <option value="0">::Seleccione::</option>
                                            <option value="1">1</option>
                                            <option value="2">2</option>
                                            <option value="3">3</option>
                                            <option value="4">4</option>
                                            <option value="5">5</option>
                                        </select></td>
                                </tr>
                                <tr>
                                    <td>C&oacute;digo Habilitaci&oacute;n</td>
                                    <td><input type="text" size="30" onkeyup="this.value=this.value.toUpperCase()" name="codhabilitacion" id="codhabilitacion" maxlength="25" value="" class="ui-widget-content" /></td>
                                </tr>
                                <tr>
                                    <td>Departamento</td>
                                    <td><select name="id_depto" id="id_depto" style="width: 330px" class="text ui-widget-content"></select></td>
                                </tr>
                                <tr>
                                    <td>Municipio</td>
                                    <td><select name="id_mupio" id="id_mupio" style="width: 330px" class="text ui-widget-content"></select></td>

                                </tr>
                                <tr>
                                    <td>Direcci&oacute;n</td>
                                    <td><input type="text" size="30" onkeyup="this.value=this.value.toUpperCase()" name="direccion" id="direccion" maxlength="25" value="" class="ui-widget-content" /></td>
                                </tr>
                                <tr>
                                    <td>Tel&eacute;fono</td>
                                    <td><input type="text" size="30" onkeyup="this.value=this.value.toUpperCase()" name="telefono" id="telefono" maxlength="25" value="" class="ui-widget-content" /></td>
                                </tr>
                                <tr>
                                    <td>Email</td>
                                    <td><input type="text" size="30" onkeyup="this.value=this.value.toUpperCase()" name="email" id="email" maxlength="25" value="" class="ui-widget-content" /></td>
                                </tr>
                                <tr>
                                    <td>Logo</td>  
                                    <td><input type="file" name="filelogo" id="filelogo"/></td> 

                                </tr> 
                            </table>

                        </div>
                         <div id="tabs-2">
                             <table>
                             
                              <tr>
                                    <td>Resoluci&oacute;n</td>
                                    <td><input type="text" size="30" onkeyup="this.value=this.value.toUpperCase()" name="direccion" id="direccion" maxlength="25" value="" class="ui-widget-content" /></td>
                                </tr>
                                <tr>
                                    <td>Cantidad XXX</td>
                                    <td><input type="text" size="30" onkeyup="this.value=this.value.toUpperCase()" name="telefono" id="telefono" maxlength="25" value="" class="ui-widget-content" /></td>
                                </tr>
                                <tr>
                                    <td>Gerente</td>
                                    <td><input type="text" size="30" onkeyup="this.value=this.value.toUpperCase()" name="email" id="email" maxlength="25" value="" class="ui-widget-content" /></td>
                                </tr>
                                 
                             </table>  
                             
                         </div>    
                        


                    </form>  
                </div>
            </div>

            <iframe id="uploadiframe" name="uploadiframe" style="display: none;" ></iframe>


            <div class="qtip qtip-stylename">
                <div class="qtip-tip" rel="cornerValue"></div>
                <div class="qtip-wrapper">
                    <div class="qtip-borderTop"></div>
                    <div class="qtip-contentWrapper">
                        <div class="qtip-title">
                            <div class="qtip-button"></div>
                        </div>
                        <div class="qtip-content"></div>
                    </div>
                    <div class="qtip-borderBottom"></div>
                </div>
            </div>

        </body>
    </f:view>
</html>
